object fmrFindClients: TfmrFindClients
  Left = 422
  Top = 155
  Width = 800
  Height = 521
  Caption = #1055#1086#1080#1089#1082' '#1075#1088#1072#1078#1076#1072#1085
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  Position = poMainFormCenter
  PixelsPerInch = 96
  TextHeight = 13
  object gbSearch: TGroupBox
    Left = 0
    Top = 0
    Width = 792
    Height = 53
    Align = alTop
    Caption = ' '#1055#1072#1088#1072#1084#1077#1090#1088#1099' '#1087#1086#1080#1089#1082#1072' '
    TabOrder = 0
    object Label1: TLabel
      Left = 12
      Top = 24
      Width = 36
      Height = 13
      Caption = #1060'.'#1048'.'#1054'.'
    end
    object eName: TEdit
      Left = 56
      Top = 22
      Width = 218
      Height = 19
      BevelKind = bkFlat
      BorderStyle = bsNone
      CharCase = ecUpperCase
      TabOrder = 0
      OnKeyPress = eNameKeyPress
    end
    object cbBDate: TCheckBox
      Left = 287
      Top = 23
      Width = 102
      Height = 17
      Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
      TabOrder = 1
      OnClick = cbBDateClick
    end
    object dbdeBDate: TDBDateTimeEditEh
      Left = 395
      Top = 22
      Width = 81
      Height = 19
      AlwaysShowBorder = True
      Enabled = False
      EditButtons = <>
      Flat = True
      Kind = dtkDateEh
      TabOrder = 2
      Visible = True
    end
    object dbcbSex: TDBComboBoxEh
      Left = 538
      Top = 22
      Width = 49
      Height = 19
      AlwaysShowBorder = True
      Enabled = False
      EditButtons = <>
      Flat = True
      Items.Strings = (
        '-'
        #1052
        #1046)
      KeyItems.Strings = (
        '-'
        #1052
        #1046)
      TabOrder = 4
      Visible = True
    end
    object cbSex: TCheckBox
      Left = 488
      Top = 23
      Width = 45
      Height = 17
      Caption = #1055#1086#1083
      TabOrder = 3
      OnClick = cbSexClick
    end
    object bSearch: TButton
      Left = 596
      Top = 19
      Width = 60
      Height = 25
      Caption = #1055#1086#1080#1089#1082
      TabOrder = 5
      OnClick = bSearchClick
    end
    object bSelect: TButton
      Left = 658
      Top = 19
      Width = 60
      Height = 25
      Caption = #1042#1099#1073#1088#1072#1090#1100
      TabOrder = 6
      OnClick = bSelectClick
    end
    object Button1: TButton
      Left = 720
      Top = 19
      Width = 60
      Height = 25
      Caption = #1053#1086#1074#1099#1081
      TabOrder = 7
      OnClick = Button1Click
    end
  end
  object pResult: TPanel
    Left = 0
    Top = 53
    Width = 792
    Height = 441
    Align = alClient
    BevelInner = bvRaised
    BevelOuter = bvLowered
    TabOrder = 1
    object dbgClients: TDBGridEh
      Left = 2
      Top = 2
      Width = 788
      Height = 437
      Align = alClient
      ColumnDefValues.Title.TitleButton = True
      DataGrouping.GroupLevels = <>
      DataSource = dsc_Clients
      Flat = True
      FooterColor = clWindow
      FooterFont.Charset = DEFAULT_CHARSET
      FooterFont.Color = clWindowText
      FooterFont.Height = -11
      FooterFont.Name = 'MS Sans Serif'
      FooterFont.Style = []
      Options = [dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
      OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghAutoSortMarking, dghMultiSortMarking, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghColumnMove]
      RowDetailPanel.Color = clBtnFace
      SortLocal = True
      TabOrder = 0
      TitleFont.Charset = DEFAULT_CHARSET
      TitleFont.Color = clWindowText
      TitleFont.Height = -11
      TitleFont.Name = 'MS Sans Serif'
      TitleFont.Style = []
      UseMultiTitle = True
      VTitleMargin = 5
      OnDblClick = bSelectClick
      OnSortMarkingChanged = dbgClientsSortMarkingChanged
      Columns = <
        item
          EditButtons = <>
          FieldName = 'ID'
          Footers = <>
        end
        item
          EditButtons = <>
          FieldName = 'NAME'
          Footers = <>
        end
        item
          EditButtons = <>
          FieldName = 'BIRTHDATE'
          Footers = <>
        end
        item
          EditButtons = <>
          FieldName = 'SEX'
          Footers = <>
        end
        item
          EditButtons = <>
          FieldName = 'ADDRESS'
          Footers = <>
        end>
      object RowDetailData: TRowDetailPanelControlEh
      end
    end
  end
  object dsc_Clients: TDataSource
    DataSet = ds_Clients
    Left = 204
    Top = 149
  end
  object ds_Clients: TpFIBDataSet
    SelectSQL.Strings = (
      'select '
      '  c.id,'
      '  c.name,'
      '  c.birthdate,'
      '  c.sex,'
      '  (select first(1) (select v.address from v_abons v'
      '              where v.id = p.rabonent_id)'
      '     from proc_client_get_status(c.id, current_date) p'
      '     where rstatus > 0'
      '     order by rstatus) as address'
      'from clients c'
      'where c.id >= 0'
      '  and c.name containing :pname'
      '  and (:pctype = -1 or c.ctype = :pctype)'
      '  @@fbirthdate@'
      '  @@fsex@'
      '  @@c_id@'
      'order by c.name')
    AfterOpen = ds_ClientsAfterOpen
    Transaction = LocalTrans
    Database = MAINDM.pMainDatabase
    Left = 172
    Top = 149
    object ds_ClientsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_ClientsNAME: TFIBStringField
      DisplayLabel = #1060#1048#1054
      DisplayWidth = 30
      FieldName = 'NAME'
      Size = 120
      EmptyStrToNull = True
    end
    object ds_ClientsBIRTHDATE: TFIBDateField
      DisplayLabel = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
      DisplayWidth = 12
      FieldName = 'BIRTHDATE'
    end
    object ds_ClientsSEX: TFIBStringField
      DisplayLabel = #1055#1086#1083
      DisplayWidth = 5
      FieldName = 'SEX'
      Size = 1
      EmptyStrToNull = True
    end
    object ds_ClientsADDRESS: TFIBStringField
      DisplayLabel = #1040#1076#1088#1077#1089
      DisplayWidth = 60
      FieldName = 'ADDRESS'
      Size = 245
      EmptyStrToNull = True
    end
  end
  object LocalTrans: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 108
    Top = 149
  end
end
